Setup the bridge
Guide to initialize your bridge
The front-end application is just a sample, meaning that you can build the front-end in the way you like the most!!
If you are a test net user request the source codes of the bridge and example front-end application by contacting us via email, in the slack channel, or from the contact button in the UI to request a redemption code.
Back-end
Enter the repository.
In the truffle-config.js
Inside networks, modify the mnemonic phrase and the address for the 1DLT node and the target chain (e.g., Ropsten).
Update the .env file.
Solidity contracts
To deploy the contracts, we rely on Truffle.
Initialize your project:
Start the migration of the contracts on the two blockchains.
Copy the transaction hash of the generated smart contracts.
Insert the transaction hashed in the public node page.
Press the "add to node" button. This button will trigger the verification, and if successful, the result will look like this:
If you do not want to use the Front-end skip this section and jump to the next one!
Front-end
Enter the repository.
Install the dependencies.
This front end is just an example, which allows you to deposit tokens into 1DLT from a fixed source blockchain (e.g. Ropsten testnet) or withdraw tokens from the same blockchain.
Start the front end.
Get the addresses of the smart contracts.
Result:
To see the token in 1DLT, you have to configure Metamask.
Open Metamask and select the account you want to use.
Then, under the tab "assets", select the "import tokens" button.
Insert the contract address of the target token, the symbol, and the decimals for both the blockchains.
Result:
From the Back-End terminal, start the Bridge API with:
Result:
In another terminal, start the front-end:
Result:
Select the amount you want to transfer to 1DLT and press the transfer button.
Shortly after, you will see the updated amount in Metamask.
If you want to withdraw, select the amount:
Shortly after, you will see the updated amount in the Metamask
Import an NFT From Ethereum to 1DLT
Before executing the transfer, we check the NFT existence in the two blockchains.
1DLT
Result:
Ropsten
Result:
We have no tokens in the account on 1DLT, while we have one token on Ethereum. The owner's address is printed on the terminal and should match your address.
Now, in a new terminal, start the bridge:
And in the first terminal, execute the transfer:
Result:
We check if the token has been transferred from Ethereum to 1DLT:
Result:
Then on 1DLT
Result:
Last updated