Mining With AWS Nitro
Last updated
Last updated
First you'll need to create a new IAM Policy to allow the use of the KMS key to only be used inside the enclave. Open the "IAM -> Policies" page, and then click the "Create Policy" button to load the create policy page. You'll next select the "JSON" tab and paste the following json configs:
After creatiing the policy you should see a new policy like this:
For more information please read the AWS docs.
Open the "IAM -> Roles" page and click the "Create role" button to create a new IAM role, then select the first box:
In the second step you can input "key" as a word filter to make it easier to find and select the following two policies:
"AWSKeyManagementServicePowerUser"
The IAM policy we created earlier
Finally, enter the new role name and remember it for future use.
Select the "EC2 -> Security Groups" page and choose a security group you want to modify (or create a new one). You'll need to add the following inbound rules:
These input ports will be filtered after the node is started.
With the preliminary steps out of the way, we can now setup our EC2 instance. First select the region you want your EC2 instance to be deployed to.
In the above image you can see that the "Asia Pacific (Seoul)" region was chosen with the region code "ap-northeast-2". Please keep this region code in mind because this code will be used as the last parameter in the "install" and "start" scripts below.
To ensure a successful instance launch, follow the setup instructions below:
Choose the "Amazon Linux" OS (DO NOT use the default "Amazon Linux 2023 AMI" option):
Choose an instance type that supports nitro. We'll use the "c5a.xlarge":
Use the security group we updated (created) earlier:
(optional) It's better to increase the volume size from 8G to 30G:
In the "Advanced details" tab, use the IAM role we created above:
In the "advanced details" tab set "Nitro Enclave" as enabled:
After successfully launching the EC2 instance, you can access it via ssh and proceed with the next steps of the tutorial.
First you'll need to prepare the TEA node dependencies which should take about 10 minutes.
Please note that the following preparations need only be completed once before starting the node for the first time.
Before running the next few scripts you should have a Machine_ID registered to your ETH address. You can contact us on Telegram to get a Machine_ID.
Run the following command to start or update to the newest TEA software version:
Or using the following command without prompting (replace the Machine_ID and wallet_ID with your own values):
The above command uses the region code of ap-northeast-2
but you should change this according to the region you use (i.e. an Oregon server will have a us-west-2
region code).
Make sure you're in. the working directory of the "nitro-build" folder created automatically in the preparation step. If not, then navigate to that folder:
Then simply run the following script to start the node with parts both inside and outside the enclave using the same Machine_ID and wallet_address you used during the install process. For example, if 0x0000000000000000000000000000000000000000000000000000000000000000
was the Machine_ID and 0xbd6D4f56b59e45ed25c52Eab7EFf2c626e083db9
was the wallet address:
The above command uses the region code of ap-northeast-2
but you should change this according to the region you used for your EC2 instance.
You can now visit the Nitro TApp Store to purchase a CML and plant it inside your machine.
Go to the Nitro TApp Store and click on the TApps tab.
If you don't have a CML, you can bid for one in the Seed Auction TApp. The CML seed will be available one hour after the last placed bid.
After you're done planting, your node is ready to host TApps.
After you've claimed your CML, you can plant it into your AWS machine using the Miner Portal. During the planting process, select the same Machine_ID that you used to setup your AWS node as well as your AWS node's IP address. You can find your node's IP address in your AWS console: