Avalanche Francophone
  • Documentation du développeur
  • Apprendre
    • Aperçu de la plateforme
      • Staking
      • Frais de transaction
    • Les bases de la blockchain
    • FAQ
    • Forum
    • Communauté
  • Créer
  • Pour commencer: exécuter un nœud Avalanche
  • Notes de version
    • Alertes par email
    • Notes de mise à jour d'AvalancheGo
    • Notes de mise à jour d'Ortelius
  • Tutoriels
    • Plateforme
      • Créer une nouvelle blockchain
      • Créer un Réseau Local Testnet
      • Créer un sous-réseau (subnet)
      • Créer une Machine Virtuelle (VM)
      • Configurez votre Ledger Nano S avec Avalanche
      • Transférer de l'AVAX entre la X-Chain et la C-Chain
      • Transférer de l'AVAX entre la X-Chain et la P-Chain
    • Nœuds et mise en jeu
      • Ajouter un validateur
      • Maintenir un nœud Avalanche
      • Exécutez un nœud Avalanche et devenez validateur
      • Exécuter un nœud Avalanche avec Oracle VM VirtualBox
      • Exécutez un nœud Avalanche avec un Raspberry Pi 4
      • Exécutez un nœud Avalanche et faites une mise en jeu avec le portefeuille
      • Exécuter un nœud Avalanche avec OVH
      • Exécuter un nœud Avalanche avec Amazon Web Services (AWS)
      • Exécuter un nœud Avalanche avec Microsoft Azure
      • Exécuter un nœud Avalanche sous Linux à l'aide du script d'installation
      • Configuration du monitoring des nœuds
      • Mise en jeu d'AVAX, en validant ou délégant via le portefeuille Avalanche
      • Déléguer à un nœud
      • Sécurisation d'un serveur VPS
      • Mettez à niveau votre nœud AvalancheGo
    • Contrats intelligents
      • Déployer un contrat intelligent en utilisant Remix et MetaMask
      • Utilisation de Truffle avec la C-Chain d'Avalanche
    • Actifs Numériques Intelligents
      • Créer un token ERC-20
      • Créer un actif à capitalisation fixe
      • Créer un actif à capitalisation variable
      • Création d'un NFT - Partie 1
      • Créez des NFT avec le portefeuille Avalanche
      • Utilisez les Wrapped AVAX (WAVAX) sur Avalanche
  • AvalancheGo APIs
    • Émettre des appels d'API
    • Platform API (P-Chain)
    • EVM API (C-Chain)
    • AVM API (X-Chain)
    • Appels d'API obsolètes
    • API Admin
    • API Auth
    • API Health
    • API Info
    • API IPC
    • API Keystore
    • API Metrics
    • API Timestamp
  • Outils
    • AvalancheJS
      • Créer un actif sur la X-Chain
      • Management des clés sur la X-Chain
      • Envoyer un actif sur la X-Chain
      • API
    • Avash
    • Ortelius
  • Références
    • AVM Transaction Format
    • Command Line Interface
    • Coreth Atomic Transaction Format
    • Cryptographic Primitives
    • Network Protocol
    • Serialization Primitives
    • Platform Transaction Format
  • Papiers
Propulsé par GitBook
Sur cette page
  • Endpoint
  • Méthodes
  • timestamp.getBlock
  • timestamp.proposeBlock

Cet article vous a-t-il été utile ?

  1. AvalancheGo APIs

API Timestamp

Cette API permet aux clients d'interagir avec la chaîne d'horodatage.

PrécédentAPI MetricsSuivantOutils

Dernière mise à jour il y a 4 ans

Cet article vous a-t-il été utile ?

La chaîne d'horodatage est un serveur d'horodatage. Chaque bloc contient le payload en 32 octets et l'horodatage de la création du bloc.

Les d'une nouvelle instance de la chaîne d'horodatage sont la payload en 32 octets du bloc de genèse.

Endpoint

/ext/timestamp

Méthodes

timestamp.getBlock

Obtenez un bloc par son identifiant. Si aucun ID n'est fourni, obtenez le dernier bloc.

Signature

timestamp.getBlock({id: string}) ->
    {
        id: string,
        data: string,
        timestamp: int,
        parentID: string
    }
  • id est l'ID du bloc en cours de récupération. Si omis des arguments, obtient le dernier bloc.

  • data est la représentation en base 58 (avec somme de contrôle) du payload en 32 octets du bloc.

  • timestamp est l'horodatage Unix lorsque ce bloc a été créé.

  • parentID est le parent du bloc.

Exemple d'un Appel

curl -X POST --data '{
    "jsonrpc": "2.0",
    "method": "timestamp.getBlock",
    "params":{
        "id":"xqQV1jDnCXDxhfnNT7tDBcXeoH2jC3Hh7Pyv4GXE1z1hfup5K"
    },
    "id": 1
}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/timestamp

Example de Réponse

{
    "jsonrpc": "2.0",
    "result": {
        "timestamp": "1581717416",
        "data": "11111111111111111111111111111111LpoYY",
        "id": "xqQV1jDnCXDxhfnNT7tDBcXeoH2jC3Hh7Pyv4GXE1z1hfup5K",
        "parentID": "22XLgiM5dfCwTY9iZnVk8ZPuPe3aSrdVr5Dfrbxd3ejpJd7oef"
    },
    "id": 1
}

timestamp.proposeBlock

Proposez la création d'un nouveau bloc.

Signature

timestamp.proposeBlock({data: string}) -> {success: bool}
  • data est la représentation en base 58 (avec somme de contrôle) du payload en 32 octets du bloc proposé.

Exemple d'un Appel

curl -X POST --data '{
    "jsonrpc": "2.0",
    "method": "timestamp.proposeBlock",
    "params":{
        "data":"SkB92YpWm4Q2iPnLGCuDPZPgUQMxajqQQuz91oi3xD984f8r"
    },
    "id": 1
}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/timestamp

Exemple de Réponse

{
    "jsonrpc": "2.0",
    "result": {
        "Success": true
    },
    "id": 1
}
données de genèse