This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
AWSTemplateFormatVersion: '2010-09-09' | |
Description: 'Jenkins Role' | |
Resources: | |
JenkinsRole: | |
Type: AWS::IAM::Role | |
Properties: | |
Description: "Used for serverspec tests" | |
RoleName: jenkins-serverspec |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'serverspec' | |
set :backend, :exec | |
describe command('lsb_release -a') do | |
its(:stdout){ should contain 'Ubuntu' } | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!groovy | |
import groovy.transform.Field | |
@Field | |
def keyName | |
@Field | |
def instanceId | |
@Field | |
def securityGroupId |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'serverspec' | |
require_relative '../serverspec_config' | |
describe command('lsb_release -a') do | |
its(:stdout){ should contain 'Ubuntu' } | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'serverspec' | |
set :disable_sudo, true | |
set :backend, :ssh | |
set :host, ENV['INSTANCE_IP'] | |
set :ssh_options, { | |
:user => 'ubuntu', | |
:auth_methods => [ 'publickey' ], | |
:keys => [ ENV['SSH_KEY_PATH'] ], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async fn process_wallet(wallet: String, api_key: &String) { | |
let mut page = 1; | |
let mut transaction_to_token_id = HashMap::new(); | |
loop { | |
let transactions = fetch_transactions(wallet.clone(), api_key, page).await; | |
if transactions.is_empty() { | |
break; | |
} | |
for res in transactions { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const LAND_CONTRACT: &str = "0x7a47f7707c4b2f2b1def04a47cd8681d48eadeb8"; | |
const LAND_CONTRACT_CREATION_BLOCK: &str = "14846665"; | |
const LAND_FUNCTION_NAME: &str = "buyL2"; | |
pub async fn read_transactions() { | |
let api_key = String::from("ETHERSCAN_API_KEY_VALUE"); | |
match mints_reader::read_mints().await { | |
Some(mints) => { | |
let mut futures = futures::stream::iter(mints.result) | |
.map(|res| process_wallet(res.wallet, &api_key)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[derive(Deserialize, Debug)] | |
pub struct Token { | |
pub status: String, | |
pub result: Option<Vec<TheResult>>, | |
} | |
#[derive(Deserialize, Debug)] | |
pub struct TheResult { | |
pub hash: String, | |
pub value: String, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[derive(Deserialize, Debug)] | |
pub struct Transaction { | |
pub status: String, | |
pub result: Option<Vec<TheResult>>, | |
} | |
#[derive(Deserialize, Debug)] | |
pub struct TheResult { | |
pub hash: String, | |
pub from: String, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const MINTS_URL: &str = "https://api.x.immutable.com/v1/mints?token_address=0x9e0d99b864e1ac12565125c5a82b59adea5a09cd&page_size=200"; | |
pub async fn read_mints() -> Option<Mint> { | |
match api_utils::fetch_single_api_response::<Mint>(MINTS_URL).await { | |
Ok(mints) => { Some(mints) } | |
Err(e) => { | |
error!("Error fetching mints {e}"); | |
None | |
} | |
} |